<div class="form_item_block" id="artifact_id_input">
  <%= label_tag random_dom_id('pipeline_'), required_label_text('Artifact ID') -%>
  <%= scope[:var_form].text_field com.thoughtworks.go.config.FetchPluggableArtifactTask::ARTIFACT_ID, {:name => "task[artifactId]", :id => "task_artifactId"} %>
  <div class="contextual_help has_go_tip_right" title="The ID of the artifact."></div>
  <%= error_message_on(@task, com.thoughtworks.go.config.FetchPluggableArtifactTask::ARTIFACT_ID, :css_class => "form_error") %>
</div>

<div class="plugin_form_background">
  <div class="form_item_block artifact_plugin_selection plugin_dropdown_background">
    <span>Cannot determine plugin to show the configuration view. Please choose a plugin to configure the plugin properties.<span class="contextual_help has_go_tip_right" title="The plugin with which the artifact is associated cannot be determined because: the pipeline, stage, job or artifact id  is a parameter or is non-existent."/></span>
    <label>Plugin ID</label>
    <%= scope[:var_form].select("pluginId", scope[:artifact_plugin_to_fetch_view].collect {|p| [p.to_hash["name"], p.to_hash["id"]]}, {:prompt => 'Select Plugin'}) %>
    <%= error_message_on(@task, "pluginId", :css_class => "form_error") %>
  </div>

  <div class="form_item_block hidden" id="fetch_pluggable_task_view">
  </div>

  <div class="plugin-config-read-only plugin_key_value hidden">
    <% scope[:task].getConfiguration().getPropertyMetadataAndValuesAsMap().to_hash.each do |config_property| %>
      <dl class="key-value-pair">
        <dt><%= config_property[0] %></dt>
        <dd><%= config_property[1]['displayValue'] %></dd>
        <input type="hidden" name="task[configuration][<%= config_property[0] %>][value]" value="<%= config_property[1]['value'] %>"/>
        <input type="hidden" name="task[configuration][<%= config_property[0] %>][isSecure]" value="<%= config_property[1]['isSecure'] %>"/>
      </dl>
    <% end %>
  </div>

  <span id="fetch_external_artifact_data" style="display: none">
    <%== com.google.gson.Gson.new.toJson(scope[:task].getConfiguration().getConfigWithErrorsAsMap()) %>
</span>
</div>